<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="z" uri="zz"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@include file="/views/common/common.jsp"%>
	<script type="text/javascript">

		/**
		 * 执行展期
		 * @constructor
		 */
		function RunRenew(){
			var userid = $("#userid_id").val();
			var amount = $("#amount_id").val();
			var customer_other_number = encodeURIComponent($("#customer_other_number").val());
			var remarks = encodeURIComponent($("#remarks").val());
			if(isNotNull(userid)){
					if(amount>0){
						$.messager.confirm('信息提示','您确定要给'+userid+'执行展期吗？',function(r){
							if (r){
								$.ajax({
									type : "get",
									url : "zs",
									data:{serviceid:'directCustomerRenew',userid:userid,amount:amount,customer_other_number:customer_other_number,remarks:remarks},
									success : function(data) {
										if(data.code!='SUCCESS'){
											parent.alertMessager('充值成功');
											location.reload();
										}
									},
									error: function (data) {
										parent.alertErrorMessager('ajax错误：'+JSON.stringify(data));
									}
								});
							}
						});
					}else{
						parent.alertErrorMessager('金额不可为0');
					}
			}else{
				parent.alertErrorMessager('客户不能为空');
			}
		}

	</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north'" class="border-top-0 border-right-0 border-left-0" style="height:38px;overflow:hidden">
	<div id="ButtonHR" class="btn-group" role="group">
		<c:if test="${is_mobile=='1'}" >
			<button id="return_button" type="button" class="btn btn-light" onclick="window.location.href='user_center_mobile';"><i class="fa fa-hand-o-left"></i> 返回</button>
		</c:if>
		<button id="RunRechargeButton" type="button" class="btn btn-light" onclick="RunRenew();"><i class="fa fa-floppy-o"></i> 执行展期</button>
	</div>

</div>
<div data-options="region:'center',border:false">
	<z:column column_size="4" column_type="8" column_id="userid" column_name="客户" column_help="客户" tableId="erp_account" z5_table="crm_customer" z5_key="zid" z5_value="name" />
	<z:column column_size="4" column_type="2" column_id="amount" column_name="金额" 	column_help="金额"/>
	<z:column column_size="4" column_type="1" column_id="customer_other_number" column_name="其它账号" 	column_help="数据格式示例：H8888888,H9999999,CN777777" />
	<z:column column_size="4" column_type="1" column_id="remarks" column_name="备注" 	column_help="银行充值记录号" />
</div>

<%@include file="/views/common/body.jsp"%>
</body>
</html>